package com.ruoyi.report_tg.domain.vo;

import java.util.ArrayList;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.ruoyi.common.utils.BigDecimalUtil;
import com.ruoyi.syrw.common.GaussianFunction;
import com.ruoyi.syrw.common.LineFunction;
import lombok.Data;

import java.util.List;


/**
 * 土的承载比(CBR)记录二视图对象 report_tg_tdczbjlbe_bs_info
 *
 * @author zyb
 * @date 2024-05-24
 */
@Data
@ExcelIgnoreUnannotated
public class TdczbjlbeBsInfoVo extends ExcelGeneralVo {

    private static final long serialVersionUID = 1L;

    /**
     * 一份excel表格的唯一id(其他的excel主表，都应有此字段）
     */
    @ExcelProperty(value = "一份excel表格的唯一id(其他的excel主表，都应有此字段）")
    private Long excelId;

    /**
     * 画图所需的点
     */
    private final List<GeneralCharDataVo>[] chartDatas = new ArrayList[3];


    /**
     * 共几页
     */
    @ExcelProperty(value = "共几页")
    private Long totalPage;

    /**
     * 第几页
     */
    @ExcelProperty(value = "第几页")
    private Long page;

    /**
     * 记录编号
     */
    @ExcelProperty(value = "记录编号")
    private String jilbh;

    /**
     * 检测单位名称
     */
    @ExcelProperty(value = "检测单位名称")
    private String jiancdwmc;

    /**
     * 工程部位/用途
     */
    @ExcelProperty(value = "工程部位/用途")
    private String gongcbwyt;

    /**
     * 样品名称
     */
    @ExcelProperty(value = "样品名称")
    private String yangpmc;

    /**
     * 样品编号
     */
    @ExcelProperty(value = "样品编号")
    private String yangpbh;

    /**
     * 样品数量
     */
    @ExcelProperty(value = "样品数量")
    private String yangpsl;

    /**
     * 样品状态
     */
    @ExcelProperty(value = "样品状态")
    private String yangpzt;

    /**
     * 样品时间
     */
    @ExcelProperty(value = "样品时间")
    private String yangpsj;

    /**
     * 试验检测日期
     */
    @ExcelProperty(value = "试验检测日期")
    private String shiyjcrq;

    /**
     * 试验条件温度
     */
    @ExcelProperty(value = "试验条件温度")
    private String shiytjwd;

    /**
     * 试验条件湿度
     */
    @ExcelProperty(value = "试验条件湿度")
    private String shiytjsd;

    /**
     * 检测依据
     */
    @ExcelProperty(value = "检测依据")
    private String jiancyj;

    /**
     * 判定依据
     */
    @ExcelProperty(value = "判定依据")
    private String pandyj;

    /**
     * 主要仪器设备名称及编号
     */
    @ExcelProperty(value = "主要仪器设备名称及编号")
    private String zhuyyqsbmcjbh;

    /**
     * 附加声明
     */
    @ExcelProperty(value = "附加声明")
    private String fujsm;

    /**
     * 最大干密度
     */
    @ExcelProperty(value = "最大干密度")
    private String zuidgmd;

    /**
     * 最佳含水率
     */
    @ExcelProperty(value = "最佳含水率")
    private String zuijhsl;

    /**
     * 贯入杆面积A
     */
    @ExcelProperty(value = "贯入杆面积A")
    private String guanrgmj;

    /**
     * 筒号1
     */
    @ExcelProperty(value = "筒号1")
    private String tongh1;

    /**
     * 筒号2
     */
    @ExcelProperty(value = "筒号2")
    private String tongh2;

    /**
     * 筒号3
     */
    @ExcelProperty(value = "筒号3")
    private String tongh3;

    /**
     * 每层击数1
     */
    @ExcelProperty(value = "每层击数1")
    private Long meicjs1;

    /**
     * 每层击数2
     */
    @ExcelProperty(value = "每层击数2")
    private Long meicjs2;

    /**
     * 每层击数3
     */
    @ExcelProperty(value = "每层击数3")
    private Long meicjs3;

    /**
     * 单位压力2.5mm1
     */
    @ExcelProperty(value = "单位压力2.5mm1")
    private String danwyl2p5mm1;

    /**
     * 单位压力2.5mm2
     */
    @ExcelProperty(value = "单位压力2.5mm2")
    private String danwyl2p5mm2;

    /**
     * 单位压力2.5mm3
     */
    @ExcelProperty(value = "单位压力2.5mm3")
    private String danwyl2p5mm3;

    /**
     * CBR2.5mm1
     */
    @ExcelProperty(value = "CBR2.5mm1")
    private String cbr2p5mm1;

    /**
     * CBR2.5mm2
     */
    @ExcelProperty(value = "CBR2.5mm2")
    private String cbr2p5mm2;

    /**
     * CBR2.5mm3
     */
    @ExcelProperty(value = "CBR2.5mm3")
    private String cbr2p5mm3;

    /**
     * 单位压力5.0mm1
     */
    @ExcelProperty(value = "单位压力5.0mm1")
    private String danwyl5p0mm1;

    /**
     * 单位压力5.0mm2
     */
    @ExcelProperty(value = "单位压力5.0mm2")
    private String danwyl5p0mm2;

    /**
     * 单位压力5.0mm3
     */
    @ExcelProperty(value = "单位压力5.0mm3")
    private String danwyl5p0mm3;

    /**
     * CBR5.0mm1
     */
    @ExcelProperty(value = "CBR5.0mm1")
    private String cbr5p0mm1;

    /**
     * CBR5.0mm2
     */
    @ExcelProperty(value = "CBR5.0mm2")
    private String cbr5p0mm2;

    /**
     * CBR5.0mm3
     */
    @ExcelProperty(value = "CBR5.0mm3")
    private String cbr5p0mm3;

    /**
     * CBR平均值2.5mm
     */
    @ExcelProperty(value = "CBR平均值2.5mm")
    private String cbrpjz2p5;

    /**
     * CBR平均值5.0mm
     */
    @ExcelProperty(value = "CBR平均值5.0mm")
    private String cbrpjz5p0;

    /**
     * 详细表
     */
    List<TdczbjlbeBaDetailVo> baDetailVos;

    public TdczbjlbeBsInfoVo() {
        baDetailVos = new ArrayList<>(36);
        for (long i = 0; i < 12L; i++) {
            for (long l = 0; l < 3L; l++) {
                baDetailVos.add(new TdczbjlbeBaDetailVo(1111L, i, l));
            }
        }
    }

    /**
     * 设备ids
     */
    private String shebIds;

//    public void setZuidgmd(String zuidgmd) {
//        this.zuidgmd = BigDecimalUtil.stpTrailZero(zuidgmd);
//    }
//
//    public void setZuijhsl(String zuijhsl) {
//        this.zuijhsl = BigDecimalUtil.stpTrailZero(zuijhsl);
//    }
//
//    public void setGuanrgmj(String guanrgmj) {
//        this.guanrgmj = BigDecimalUtil.stpTrailZero(guanrgmj);
//    }
//
//    public void setDanwyl2p5mm1(String danwyl2p5mm1) {
//        this.danwyl2p5mm1 = BigDecimalUtil.stpTrailZero(danwyl2p5mm1);
//    }
//
//    public void setDanwyl2p5mm2(String danwyl2p5mm2) {
//        this.danwyl2p5mm2 = BigDecimalUtil.stpTrailZero(danwyl2p5mm2);
//    }
//
//    public void setDanwyl2p5mm3(String danwyl2p5mm3) {
//        this.danwyl2p5mm3 = BigDecimalUtil.stpTrailZero(danwyl2p5mm3);
//    }
//
//    public void setCbr2p5mm1(String cbr2p5mm1) {
//        this.cbr2p5mm1 = BigDecimalUtil.stpTrailZero(cbr2p5mm1);
//    }
//
//    public void setCbr2p5mm2(String cbr2p5mm2) {
//        this.cbr2p5mm2 = BigDecimalUtil.stpTrailZero(cbr2p5mm2);
//    }
//
//    public void setCbr2p5mm3(String cbr2p5mm3) {
//        this.cbr2p5mm3 = BigDecimalUtil.stpTrailZero(cbr2p5mm3);
//    }
//
//    public void setDanwyl5p0mm1(String danwyl5p0mm1) {
//        this.danwyl5p0mm1 = BigDecimalUtil.stpTrailZero(danwyl5p0mm1);
//    }
//
//    public void setDanwyl5p0mm2(String danwyl5p0mm2) {
//        this.danwyl5p0mm2 = BigDecimalUtil.stpTrailZero(danwyl5p0mm2);
//    }
//
//    public void setDanwyl5p0mm3(String danwyl5p0mm3) {
//        this.danwyl5p0mm3 = BigDecimalUtil.stpTrailZero(danwyl5p0mm3);
//    }
//
//    public void setCbr5p0mm1(String cbr5p0mm1) {
//        this.cbr5p0mm1 = BigDecimalUtil.stpTrailZero(cbr5p0mm1);
//    }
//
//    public void setCbr5p0mm2(String cbr5p0mm2) {
//        this.cbr5p0mm2 = BigDecimalUtil.stpTrailZero(cbr5p0mm2);
//    }
//
//    public void setCbr5p0mm3(String cbr5p0mm3) {
//        this.cbr5p0mm3 = BigDecimalUtil.stpTrailZero(cbr5p0mm3);
//    }
//
//    public void setCbrpjz2p5(String cbrpjz2p5) {
//        this.cbrpjz2p5 = BigDecimalUtil.stpTrailZero(cbrpjz2p5);
//    }
//
//    public void setCbrpjz5p0(String cbrpjz5p0) {
//        this.cbrpjz5p0 = BigDecimalUtil.stpTrailZero(cbrpjz5p0);
//    }

    @Deprecated
    public void setComputValue(int i, GaussianFunction gaussianFuncLine) {
        if (i == 0) {
            this.danwyl2p5mm1 = BigDecimalUtil.defaultValue(gaussianFuncLine.getX(2.5), 2).toPlainString();
            this.cbr2p5mm1 = BigDecimalUtil.defaultValue(((100 * gaussianFuncLine.getX(2.5)) / 7000), 2).toPlainString();
            this.danwyl5p0mm1 = BigDecimalUtil.defaultValue(gaussianFuncLine.getX(5.0), 2).toPlainString();
            this.cbr5p0mm1 = BigDecimalUtil.defaultValue(((100 * gaussianFuncLine.getX(5.0)) / 10500), 2).toPlainString();
        }
        if (i == 1) {
            this.danwyl2p5mm2 = BigDecimalUtil.defaultValue(gaussianFuncLine.getX(2.5), 2).toPlainString();
            this.cbr2p5mm2 = BigDecimalUtil.defaultValue(((100 * gaussianFuncLine.getX(2.5)) / 7000), 2).toPlainString();
            this.danwyl5p0mm2 = BigDecimalUtil.defaultValue(gaussianFuncLine.getX(5.0), 2).toPlainString();
            this.cbr5p0mm2 = BigDecimalUtil.defaultValue(((100 * gaussianFuncLine.getX(5.0)) / 10500), 2).toPlainString();
        }
        if (i == 2) {
            this.danwyl2p5mm3 = BigDecimalUtil.defaultValue(gaussianFuncLine.getX(2.5), 2).toPlainString();
            this.cbr2p5mm3 = BigDecimalUtil.defaultValue(((100 * gaussianFuncLine.getX(2.5)) / 7000), 2).toPlainString();
            this.danwyl5p0mm3 = BigDecimalUtil.defaultValue(gaussianFuncLine.getX(5.0), 2).toPlainString();
            this.cbr5p0mm3 = BigDecimalUtil.defaultValue(((100 * gaussianFuncLine.getX(5.0)) / 10500), 2).toPlainString();
        }

    }

//    public void setCharDate(int i, GaussianFunction gaussianFuncLine, double[][] data) {
//
//    }


    public String[] getCompuValue(int i) {
        if (i == 0) {
            return new String[]{this.danwyl2p5mm1, this.danwyl5p0mm1};
        }
        if (i == 1) {
            return new String[]{this.danwyl2p5mm2, this.danwyl5p0mm2};
        }
        if (i == 2) {
            return new String[]{this.danwyl2p5mm3, this.danwyl5p0mm3};
        }
        return null;

    }

    public void setChart(int i, List<GeneralCharDataVo> charData) {
        this.chartDatas[i] = charData;
    }

    /**
     * 通过 行列 获取 详细vo
     * @param row 行
     * @param col 列
     * @return
     */
    public TdczbjlbeBaDetailVo getDetailVo(int row, int col) {
        for (TdczbjlbeBaDetailVo detailVo : baDetailVos) {
            if (detailVo.getCol().intValue() == col && detailVo.getRow().intValue() == row) {
                return detailVo;
            }
        }
        return null;
    }

    public void setComputValue(int i, LineFunction generalLine2p5, LineFunction generalLine5p0) {
        if (i == 0) {
            this.danwyl2p5mm1 = BigDecimalUtil.defaultValue(generalLine2p5.getX(2.5), 0).toPlainString();
            this.cbr2p5mm1 = BigDecimalUtil.defaultValue(((100 * generalLine2p5.getX(2.5)) / 7000), 1).toPlainString();
            this.danwyl5p0mm1 = BigDecimalUtil.defaultValue(generalLine5p0.getX(5.0), 0).toPlainString();
            this.cbr5p0mm1 = BigDecimalUtil.defaultValue(((100 * generalLine5p0.getX(5.0)) / 10500), 1).toPlainString();
        }
        if (i == 1) {
            this.danwyl2p5mm2 = BigDecimalUtil.defaultValue(generalLine2p5.getX(2.5), 0).toPlainString();
            this.cbr2p5mm2 = BigDecimalUtil.defaultValue(((100 * generalLine2p5.getX(2.5)) / 7000), 1).toPlainString();
            this.danwyl5p0mm2 = BigDecimalUtil.defaultValue(generalLine5p0.getX(5.0), 0).toPlainString();
            this.cbr5p0mm2 = BigDecimalUtil.defaultValue(((100 * generalLine5p0.getX(5.0)) / 10500), 1).toPlainString();
        }
        if (i == 2) {
            this.danwyl2p5mm3 = BigDecimalUtil.defaultValue(generalLine2p5.getX(2.5), 0).toPlainString();
            this.cbr2p5mm3 = BigDecimalUtil.defaultValue(((100 * generalLine2p5.getX(2.5)) / 7000), 1).toPlainString();
            this.danwyl5p0mm3 = BigDecimalUtil.defaultValue(generalLine5p0.getX(5.0), 0).toPlainString();
            this.cbr5p0mm3 = BigDecimalUtil.defaultValue(((100 * generalLine5p0.getX(5.0)) / 10500), 1).toPlainString();
        }
    }

    /**
     * α
     */
    private String arf;
    /**
     * β
     */
    private String bt;
}
